package com.lightsaber.trade.cloth.service.email;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lightsaber.trade.core.dao.BaseDao;
import com.lightsaber.trade.core.service.HppBaseServiceImpl;
import com.lightsaber.trade.cloth.dao.email.EmailTemplateDao;
import com.lightsaber.trade.cloth.entity.email.EmailNotificationType;
import com.lightsaber.trade.cloth.entity.email.EmailTemplate;

/**
 * @author
 * 
 */
@Service
@Transactional
public class EmailTemplateManager extends HppBaseServiceImpl<EmailTemplate, String> {
    @Autowired
    private EmailTemplateDao emailTemplateDao;

    @Override
    protected BaseDao<EmailTemplate, String> getDao() {
        // TODO Auto-generated method stub
        return emailTemplateDao;
    }

    /**
     * according to email notification type find roles
     */
    public List<EmailTemplate> findByEmailNotificationType(
            final EmailNotificationType emailNotificationType) {
        return emailTemplateDao.findBy("type", emailNotificationType);
    }

}
